package com.example.hidesms.dto;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;

public class SMSItem {

	private int	id;
	private String	address;
	private String	addressNameS;
	

	private String	msg;
	private String	readState;	// "0" for have not read sms and "1" for
									// have read sms
	private String	time;
	private String	timeFormated;
	private String	folderName;
	private String photoUri = null;
	private byte[]	image;
	
	public String getAddressNameS() {
		return addressNameS;
	}

	public void setAddressNameS(String addressNameS) {
		this.addressNameS = addressNameS;
	}
	public void setImage(byte[] image) {
		this.image = image;
	}

	public byte[] getImage() {
		return image;
	}
	public Bitmap getBitmapImage() {
		Bitmap bitmap = null;
		if (image != null) {
		    bitmap = BitmapFactory.decodeByteArray(image, 0, image.length);
		}
		 
		return bitmap;
	}

    public String getPhotoUri() {
        return photoUri;
    }

    public void setPhotoUri(String photoUri) {
        this.photoUri = photoUri;
    }

	public int getId() {
		return id;
	}

	public String getTimeFormated() {
		try{
			SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss dd/MM/yyyy", Locale.getDefault());
			Date date = new Date(Long.valueOf(timeFormated));
			return sdf.format(date);
		}catch (Exception e) {
			// TODO: handle exception
			return timeFormated;
		}
	}

	public void setTimeFormated(String timeFormated) {
		this.timeFormated = timeFormated;
	}

	public String getAddress() {
		return address;
	}

	public String getMsg() {
		return msg;
	}

	public String getReadState() {
		return readState;
	}

	public String getTime() {
		return time;
	}
	
	public String getFolderName() {
		return folderName;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public void setReadState(String readState) {
		this.readState = readState;
	}

	public void setTime(String time) {
		this.time = time;
	}

	public void setFolderName(String folderName) {
		this.folderName = folderName;
	}
}
